Recently, as a fuel injection apparatus which is called an injector is more widely used, the fuel injection timing, the amount of injected fuel, i.e., the air-fuel ratio, and the like can be more easily controlled, so that a higher output power, smaller fuel consumption, exhaust gas purification, and the like can be enhanced. With respect to the fuel injection timing, particularly, the state of an intake valve in a strict sense, or the phase state of a camshaft in a usual sense is detected, and fuel is usually injected in accordance with the detected state. However, a so-called cam sensor for detecting the phase state of a camshaft is expensive. In a two-wheeled vehicle, particularly, a cam sensor cannot be often employed because of a problem in that the size of a cylinder head is increased. For example, JP-A-10-227252 proposes an engine controller in which the phase state of a crankshaft and the intake pressure are detected and the stroke state of a cylinder is detected from them. When this conventional technique is used, the stroke state can be detected without detecting the phase of a camshaft, and hence the fuel injection timing and the like can be controlled in accordance with the stroke state.
When an engine is electronic-controlled as described above, it is possible to control also the ignition timing. The ignition timing affects the torque of an engine When the ignition timing is set to be: slightly advanced from the compression top dead center, the highest torque is generated. When the ignition timing is changed from it toward advance or retard, the torque is reduced. Actually, however, a specific ignition timing controlling technique for, in, for example, a state immediately after start of rotation of an engine, adequately controlling the unstable engine speed in an idling state is not proposed.
The invention is developed in order to solve the problems discussed above, and has an objective of providing an engine controller which can adequately control the engine speed in an idling state immediately after engine start or the like.